Benjamin Otte [Sun, 8 Dec 2019 04:32:35 +0000 (05:32 +0100)]
label: Compute label baselines correctly
When we were switching smallest and widest, we were not switching the
baselines.
Matthias Clasen [Sun, 8 Dec 2019 22:58:09 +0000 (17:58 -0500)]
Add GtkTreeListRow type to the docs
Matthias Clasen [Sun, 8 Dec 2019 18:48:52 +0000 (13:48 -0500)]
Add missing listmodel and selection types to the docs
Matthias Clasen [Sun, 8 Dec 2019 03:39:35 +0000 (22:39 -0500)]
tree list model: Add a missing annotation
The GtkTreeListModelCreateModelFunc returns
a new reference.
Matthias Clasen [Sun, 8 Dec 2019 00:39:02 +0000 (19:39 -0500)]
inspector: Avoid critical warnings
We were still using this but it's not defined in the UI xml.
Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2295
Matthias Clasen [Sat, 7 Dec 2019 23:20:51 +0000 (23:20 +0000)]
Merge branch 'inspector-display' into 'master'
Inspector display
See merge request GNOME/gtk!1234
Matthias Clasen [Sat, 7 Dec 2019 17:42:37 +0000 (12:42 -0500)]
inspector: Make the css tree respect inspected display
The display is used here to force reparsing the theme
on the right settings object.
Matthias Clasen [Sat, 7 Dec 2019 17:31:10 +0000 (12:31 -0500)]
inspector: Make logs respect inspected display
Matthias Clasen [Sat, 7 Dec 2019 17:30:40 +0000 (12:30 -0500)]
inspector: Make inspect button use inspected display
This may not matter, but just for cleanliness.
Matthias Clasen [Sat, 7 Dec 2019 17:30:15 +0000 (12:30 -0500)]
inspector: Make general respect inspected display
Matthias Clasen [Sat, 7 Dec 2019 17:07:12 +0000 (12:07 -0500)]
inspector: Make visual settings respect the inspected display
This is not quite complete, GTK and GSK debug flags
are not per display, and slowdown and text direction
are not either.
Matthias Clasen [Sat, 7 Dec 2019 16:48:39 +0000 (11:48 -0500)]
inspector: Make css editor respect inspected display
Stop using gdk_display_get_default and use the
inspected display instead.
Matthias Clasen [Sat, 7 Dec 2019 16:49:30 +0000 (11:49 -0500)]
inspector: Make object tree respect inspected display
Stop using gdk_display_get_dfault and use the
inspected display instead.
Matthias Clasen [Sat, 7 Dec 2019 16:08:34 +0000 (11:08 -0500)]
window: Get rid of the inspector_window static
Use the new per-display inspector plumbing and
stop relying on a static variable.
Matthias Clasen [Sat, 7 Dec 2019 15:54:10 +0000 (10:54 -0500)]
inspector: Attach inspector window to display
Give the inspector window a ::inspected-display
property, and pass a display when obtaining an
inspector window. Update the caller.
Matthias Clasen [Sat, 7 Dec 2019 15:34:17 +0000 (10:34 -0500)]
window: Inspector cleanups
Reduce the use of the inspector_window static.
The goal is to have one inspector window per
display, so we need to get rid of the static.
Matthias Clasen [Sat, 7 Dec 2019 15:05:26 +0000 (10:05 -0500)]
window: Remove inspector updating fully
Commit
05e752e096722 left some ruins behind.
Clean that up.
Matthias Clasen [Sat, 7 Dec 2019 15:00:41 +0000 (10:00 -0500)]
inspector: Init yourself
No need to have GTK call this from the outside.
Matthias Clasen [Sat, 7 Dec 2019 16:22:07 +0000 (11:22 -0500)]
inspector: Cleanup
Remove an unused enum.
Matthias Clasen [Sat, 7 Dec 2019 14:49:10 +0000 (09:49 -0500)]
Make a test with a custom display
This completely breaks the inspector.
Matthias Clasen [Thu, 5 Dec 2019 22:11:31 +0000 (22:11 +0000)]
Merge branch 'doc-update' into 'master'
doc: Cleanup doc removing mentions of gdk_surface_shape_combine_region()
See merge request GNOME/gtk!1232
Hubert Figuière [Thu, 5 Dec 2019 13:57:19 +0000 (08:57 -0500)]
doc: Cleanup doc removing mentions of gdk_surface_shape_combine_region()
Matthias Clasen [Thu, 5 Dec 2019 00:01:23 +0000 (00:01 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
fix leaks in the testsuite
See merge request GNOME/gtk!1231
Matthias Clasen [Wed, 4 Dec 2019 23:30:37 +0000 (18:30 -0500)]
Fix treelistmodel tests
They were failing to return a reference where they
need to. This was uncovered by fixing an unrelated
ref leak.
Matthias Clasen [Wed, 4 Dec 2019 12:51:04 +0000 (07:51 -0500)]
Fix leaks in tests
All the list model tests were leaking items,
because g_list_model_get_item is transfer full.
Fixing these unveils a crash in the treelistmodel
and maplistmodel tests.
Tim Sabsch [Wed, 4 Dec 2019 19:37:01 +0000 (19:37 +0000)]
Update German translation
Benjamin Otte [Sun, 1 Dec 2019 12:52:35 +0000 (13:52 +0100)]
builder: Improve error message
Benjamin Otte [Mon, 25 Nov 2019 05:06:31 +0000 (06:06 +0100)]
builder: Allow objects in gtk_builder_value_from_string_type()
Instead of throwing an error, lookup objects with
gtk_builder_get_object().
Benjamin Otte [Fri, 29 Nov 2019 07:48:48 +0000 (08:48 +0100)]
gtk-demo: Use normal way to lookup up symbols
We're a normal application, so we can use the normal way to hook up code
into builder files, which is using dlsym() for the function pointers.
There's no need to to extra work exporting static symbols.
Benjamin Otte [Mon, 2 Dec 2019 16:31:15 +0000 (17:31 +0100)]
css: Handle invalid :not() selectors
We weren't correctly ending the ( ) block when encountering an error.
Testcases added.
Fixes #2281
Timm Bäder [Tue, 3 Dec 2019 16:05:08 +0000 (16:05 +0000)]
Merge branch 'wip/wayland-hidpi-swap-region' into 'master'
Fix HiDPI swap regions on Wayland
See merge request GNOME/gtk!1228
Jonas Ådahl [Tue, 3 Dec 2019 15:42:03 +0000 (16:42 +0100)]
wayland/vulkancontext: Fix present region on HiDPI
VkPresentRegionsKHR is expected to operate in buffer coordinates, but
the region we get passed is in surface coordinates, so it must be scaled.
Jonas Ådahl [Tue, 3 Dec 2019 15:32:59 +0000 (16:32 +0100)]
wayland/glcontext: Fix damage region on HiDPI
The passed regions are in surface coordinates, but
eglSwapBuffersWithDamage() is in buffer coordinates.
Emmanuele Bassi [Tue, 3 Dec 2019 15:36:43 +0000 (15:36 +0000)]
Merge branch 'fix-treemodelsort_processed_as_treemodel' into 'master'
Annotate GtkTreeModelSort.new_with_model() appropriately
See merge request GNOME/gtk!1134
LutzLue [Tue, 3 Dec 2019 15:36:42 +0000 (15:36 +0000)]
Annotate GtkTreeModelSort.new_with_model() appropriately
The new_with_model() method is a constructor, and it returns a GtkTreeModelSort
instance, even if the C API returns a GtkTreeModel for the convenience of C
developers.
Fixes: #1077
Timm Bäder [Sat, 30 Nov 2019 11:44:30 +0000 (12:44 +0100)]
gl renderer: Implement blurred inset shadow nodes
And with this...
Fixes #1101
Timm Bäder [Sat, 30 Nov 2019 11:44:15 +0000 (12:44 +0100)]
gl renderer: Remove unused uniform from inset shadow shader
Timm Bäder [Sat, 30 Nov 2019 11:43:49 +0000 (12:43 +0100)]
opbuffer: Remove unused op member
Timm Bäder [Sat, 30 Nov 2019 08:26:01 +0000 (09:26 +0100)]
testsuite: Add an inset shadow rendering test case
Timm Bäder [Fri, 29 Nov 2019 13:40:20 +0000 (14:40 +0100)]
gl renderer: Cache current scale in RenderOpBuilder
We call ops_get_scale a lot, so this should be better. It will also make
a later x/y split for the scaling easier.
Timm Bäder [Fri, 29 Nov 2019 12:34:22 +0000 (13:34 +0100)]
cssshadowvalue: Simplify inset shadow nodes to color nodes if possible
inset shadows like this are frequently used to implement highlights in
CSS without crowing them min size of the element.
Timm Bäder [Fri, 29 Nov 2019 09:47:40 +0000 (10:47 +0100)]
gl renderer: Save one level of indentation
Timm Bäder [Fri, 29 Nov 2019 09:02:14 +0000 (10:02 +0100)]
window: Don't set invalid csd input shape
This might happen if the CSS values of the decoration node are broken,
e.g. if people *accidentally* type large negative values for the
margins.
Fixes #2268
Timm Bäder [Fri, 29 Nov 2019 08:14:55 +0000 (09:14 +0100)]
snapshot: Reorder color matrix nodes containing a transform node
A color matrix node that contains a transform node can also be expressed
the other way around, as a transform node containing a color matrix
node.
In the general case, the color matrix node will have to draw its
child to a texture so it can color every pixel of that texture, but the
renderers can short-cut this if the child of the color matrix node is
already a texture node. So if we have a node tree like
Color Matrix
- Transform
- Texture
The renderer would have to either check the grandchild of the color
matrix or simply fall back to rendering the transform node to a texture.
In the new configuration:
Transform
- Color Matrix
- Texture
The renderer can easily see that the child node of the color matrix node
is a texture, and skip rendering it to a texture.
This is for example happening in current Adwaita for spinners, which are
rotated symbolics.
Timm Bäder [Fri, 29 Nov 2019 08:13:27 +0000 (09:13 +0100)]
snapshot: Factor out color matrix merging
We will use that elsewhere in the next commit.
Timm Bäder [Fri, 29 Nov 2019 05:54:43 +0000 (06:54 +0100)]
gl renderer: Implement blurred shadow nodes
Timm Bäder [Fri, 29 Nov 2019 05:53:57 +0000 (06:53 +0100)]
gl renderer: Take a TextureRegion in blur_texture
So we can refer to textures on a texture atlas.
Timm Bäder [Fri, 29 Nov 2019 05:50:44 +0000 (06:50 +0100)]
gl renderer: Scale blur radius
We scale the texture size, so as a consequence we have to scale the blur
radius.
Timm Bäder [Thu, 28 Nov 2019 08:01:56 +0000 (09:01 +0100)]
gl renderer: Add some often needed debug code
Timm Bäder [Tue, 26 Nov 2019 08:38:53 +0000 (09:38 +0100)]
gl renderer: Blur shader improvements
Use a two-pass blur shader, fix a few other things and unify the
blurring of blur nodes and blurred outset shadow nodes.
Related to #1283
Timm Bäder [Tue, 19 Nov 2019 14:40:08 +0000 (15:40 +0100)]
testblur: Fix default blur radius
sync it up with the adjustment value. also just add the destroyed
handler.
Matthias Clasen [Mon, 2 Dec 2019 13:19:50 +0000 (13:19 +0000)]
Merge branch 'improve-popover-menu-style' into 'master'
Adwaita: Improve popover.menu styling
See merge request GNOME/gtk!1083
nana-4 [Thu, 7 Nov 2019 13:50:09 +0000 (22:50 +0900)]
Adwaita: Remove unused popover check/radio styling
nana-4 [Thu, 7 Nov 2019 13:34:01 +0000 (22:34 +0900)]
Adwaita: Flatten circular buttons in popover.menu
Just reuse the list button style.
https://gitlab.gnome.org/GNOME/gtk/issues/1824
nana-4 [Thu, 7 Nov 2019 13:00:20 +0000 (22:00 +0900)]
Adwaita: Make check & radio symbolic icon style in popover.menu
The disabled modelbutton color needs to be specified explicitly
in order for check & radio to properly read the color with
currentColor.
https://gitlab.gnome.org/GNOME/gtk/issues/1824
nana-4 [Thu, 7 Nov 2019 12:35:40 +0000 (21:35 +0900)]
Adwaita: Improve popover.menu styling
Based on the mockup:
https://gitlab.gnome.org/Teams/Design/os-mockups/blob/master/menus/menu-design-patterns.png
- Remove horizontal padding from popover.menu contents
- Remove roundness from modelbutton
- Adjust sizing to match the mockup
- Fix visual glitches on button.image-button.model
- Add missing mergin to arrow icons
- Fix accelerator position in rtl direction
- Fix accelerator color
https://gitlab.gnome.org/GNOME/gtk/issues/1824
Matthias Clasen [Sun, 1 Dec 2019 15:11:00 +0000 (15:11 +0000)]
Merge branch 'wip/muktupavels/opaque-region-master' into 'master'
window: fix opaque region
See merge request GNOME/gtk!1222
Matthias Clasen [Sun, 1 Dec 2019 15:09:39 +0000 (15:09 +0000)]
Merge branch 'sass-no-extend-compound-master' into 'master'
themes: remove various @extend with compound selectors
See merge request GNOME/gtk!1223
nana-4 [Sun, 1 Dec 2019 01:43:16 +0000 (10:43 +0900)]
themes: remove various @extend with compound selectors
They are no longer supported by sass and broken with libsass 3.6.3
(https://github.com/sass/libsass/issues/3033)
This removes them by replacing them with a placeholder selector. This at
least brings the resulting CSS size down a bit so gtk can be build
again.
`%button.flat.suggested-action` has been replaced by
`%selection_mode_button_flat`, which is a more appropriate selector for
`.selection-mode button.titlebutton`.
The CSS was generated with libsass 3.5.5.
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
See https://gitlab.gnome.org/GNOME/gtk/issues/2237
Alberts Muktupāvels [Sat, 30 Nov 2019 18:19:26 +0000 (20:19 +0200)]
window: fix opaque region
Decoration node for drawing is used only for client side decorated
windows, but corners from opaque region is subtracted also for
normal windows.
Rename function to better reflect what it does and do not subtract
corners if decoration node was not used for drawing.
Timm Bäder [Sat, 30 Nov 2019 07:40:48 +0000 (07:40 +0000)]
Merge branch 'gtk-link-color' into 'master'
Adwaita: always use link specific colors for link selector
See merge request GNOME/gtk!1201
Matthias Clasen [Fri, 29 Nov 2019 15:21:40 +0000 (15:21 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
some builder-tool tests
See merge request GNOME/gtk!1220
Matthias Clasen [Fri, 29 Nov 2019 14:51:35 +0000 (09:51 -0500)]
Update the test scripts
All tools got renamed to have a gtk4 prefix.
Matthias Clasen [Fri, 29 Nov 2019 14:50:04 +0000 (09:50 -0500)]
Add a test for the previous fix
Matthias Clasen [Fri, 29 Nov 2019 14:00:05 +0000 (14:00 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
builder-tool: Fix handling of layout properties
See merge request GNOME/gtk!1219
Matthias Clasen [Fri, 29 Nov 2019 13:47:35 +0000 (08:47 -0500)]
builder-tool: Fix handling of layout properties
We were not properly identifying layout properties
that need to be kept, causing GtkGrid left-attachment
to go missing in widget-factory.ui.
Matthias Clasen [Fri, 29 Nov 2019 13:34:09 +0000 (08:34 -0500)]
Fix up widget-factory ui
Timm Bäder [Fri, 29 Nov 2019 11:53:07 +0000 (11:53 +0000)]
Merge branch 'dont-color-labels-directly-gtk4' into 'master'
Adwaita: Avoid directly coloring labels wherever possible (GTK4)
Closes #1643
See merge request GNOME/gtk!1209
Timm Bäder [Fri, 29 Nov 2019 10:23:10 +0000 (11:23 +0100)]
reftests: Fix css-multi-state test
Properly unset theme CSS and use the right selector for the toggle
buttons.
Carlo Lobrano [Thu, 21 Nov 2019 11:32:37 +0000 (12:32 +0100)]
Adwaita: always use link specific colors for link selector
link target uses `$selected_bg_color` and `$selected_fg_color` for the
definition of some selectors (e.g. selected).
While `$link_color` and `$link_visited_color` are based on
`$selected_bg_color`, this does not seem coherent.
Replacing `$selected_*g_color` in link target style with link colors
defined in `_colors.scss file`.
Matthias Clasen [Wed, 27 Nov 2019 22:41:44 +0000 (17:41 -0500)]
widget-factory: Fix a popover menu
This one is manually constructed, and things have
changed enough for that to break. Fix it up.
Timm Bäder [Wed, 27 Nov 2019 15:56:47 +0000 (16:56 +0100)]
gl renderer: Don't use g_assert() for code that should always run
g_assert can be compiled out.
Timm Bäder [Wed, 27 Nov 2019 15:47:14 +0000 (16:47 +0100)]
gl renderer: Don't save repeat nodes to disk
This is just debuggin code someone forgot.
Matthias Clasen [Wed, 27 Nov 2019 15:14:54 +0000 (15:14 +0000)]
Merge branch 'single-compilation-symbol' into 'master'
Use a single compilation symbol
See merge request GNOME/gtk!1216
Timm Bäder [Wed, 27 Nov 2019 13:52:08 +0000 (13:52 +0000)]
Merge branch 'fix-issue-1646-master' into 'master'
HighContrast: Add missing color to entry
Closes #1646
See merge request GNOME/gtk!1215
Emmanuele Bassi [Wed, 27 Nov 2019 13:33:43 +0000 (13:33 +0000)]
Use a single compilation symbol
We use a compilation symbol in our build to allow the inclusion of
specific headers while building GTK, to avoid the need to include only
the global header.
Each namespace has its own compilation symbol because we used to have
different libraries, and strict symbol visibility between libraries;
now that we have a single library, and we can use private symbols across
namespaces while building GTK, we should have a single compilation
symbol, and simplify the build rules.
nana-4 [Wed, 27 Nov 2019 13:22:11 +0000 (22:22 +0900)]
HighContrast: Add missing color to entry
So entries don't inherit color from the parent element anymore.
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1646
Timm Bäder [Wed, 27 Nov 2019 06:46:15 +0000 (06:46 +0000)]
Merge branch 'broken-annotation' into 'master'
builder: Fix broken annotation
See merge request GNOME/gtk!1213
Robert Ancell [Wed, 27 Nov 2019 03:06:36 +0000 (16:06 +1300)]
builder: Fix broken annotation
Missing a ':', was introduced in
0627bba5a0d.
Timm Bäder [Tue, 26 Nov 2019 07:58:38 +0000 (08:58 +0100)]
gl renderer: Load flipped-y offscreen vertex data directly
Instead of loading the unflipped version first and then flipping it.
Don't do it in add_render_ops either but only in the function actually
adding the render ops for the nodes, since those frequently have
early-out conditions that don't need the vertex data at all.
Timm Bäder [Tue, 26 Nov 2019 07:41:23 +0000 (08:41 +0100)]
testsuite: Add another repeat node test case
Timm Bäder [Tue, 26 Nov 2019 07:38:41 +0000 (08:38 +0100)]
gl renderer: Fix repeat node shader once again
Timm Bäder [Sat, 23 Nov 2019 09:20:15 +0000 (10:20 +0100)]
gl renderer: Care more about 0×0 offscreen nodes
These never result in a rendering of course, but we must make sure not
to create a 0×0 texture for them, since that will cause problems later
on.
Timm Bäder [Tue, 26 Nov 2019 07:11:19 +0000 (07:11 +0000)]
Merge branch 'unsafe-strdup-printf' into 'master'
gtk-demo: Fix incorrect use of g_strdup_printf
See merge request GNOME/gtk!1211
Robert Ancell [Mon, 25 Nov 2019 21:11:28 +0000 (10:11 +1300)]
gtk-demo: Fix incorrect use of g_strdup_printf
Was broken in a refactoring in
4a2f313
nana-4 [Mon, 25 Nov 2019 15:39:33 +0000 (00:39 +0900)]
Adwaita: Avoid directly coloring labels wherever possible
Directly coloring labels can create a lot of unintended behaviors.
Unfortunately we can't avoid directly coloring `label:disabled` because
it can be used individually. This, however, tries to inherit color from
the parent element of labels wherever possible.
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1643
Benjamin Otte [Sat, 23 Nov 2019 18:33:36 +0000 (19:33 +0100)]
testsuite: Fix expected test output
This reverts part of
91497348bf1ea90ef1056bdc8727bbea645c21e3
Benjamin Otte [Sat, 23 Nov 2019 18:01:28 +0000 (19:01 +0100)]
cssprovider: Don't add empty rulesets
This change was lost during the parser changes, but the newly added test
exposes it.
And fix the expected error, the syntax has changed.
Alexandr Miloslavskiy [Thu, 21 Nov 2019 19:26:22 +0000 (20:26 +0100)]
Fix crash in parse_border()
The bug was introduced in commit:
9b7640b8 by Benjamin Otte, 2012-03-26 17:24:02
styleproperty: Make _gtk_style_property_parse_value() return a CssValue
In that commit, `values` changed from `GValue*` to `GtkCssValue**`,
but one `!G_IS_VALUE (&values[8])` was left untouched. As a result,
if `border` shorthand contains anything after color, it might crash,
depending on memory layout.
New test included.
Fixes: #751
Benjamin Otte [Sat, 23 Nov 2019 17:09:15 +0000 (17:09 +0000)]
Merge branch 'wip/otte/builder' into 'master'
Reorganize various GtkBuilder things
See merge request GNOME/gtk!1204
Benjamin Otte [Fri, 22 Nov 2019 07:29:32 +0000 (08:29 +0100)]
builder: Make the struct private
We don't want anyone to subclass it - if we want to allow bindings to
extend GtkBuilder, we will be using delegate objects/functions for it.
Benjamin Otte [Fri, 22 Nov 2019 07:25:29 +0000 (08:25 +0100)]
builder: Remove get_type_from_name() vfunc
Benjamin Otte [Fri, 22 Nov 2019 07:06:35 +0000 (08:06 +0100)]
builder: Improve signal connecting
- Propagate the error back to the parser, so we get a proper GError
instead of a g_warning().
- Connect closures by id, don't construct a name from the ids so that
glib can take it apart again.
Benjamin Otte [Fri, 22 Nov 2019 05:31:33 +0000 (06:31 +0100)]
builder: Connect signals automatically
gtk_builder_connect_signals() is no longer necessary, because all the
setup that made it necessary to have this extra step is now done
automatically via the closure functions.
Benjamin Otte [Fri, 22 Nov 2019 00:42:48 +0000 (01:42 +0100)]
reftests: Switch to gtk_builder_set_closure_func()
Benjamin Otte [Fri, 22 Nov 2019 05:54:52 +0000 (06:54 +0100)]
widget: Change templates to use closure functions
... instead of connect functions.
Benjamin Otte [Thu, 21 Nov 2019 23:18:19 +0000 (00:18 +0100)]
builder: Add gtk_builder_set_closure_func()
This allows bindings and templates to setup a way to create closures.
Benjamin Otte [Thu, 21 Nov 2019 20:30:38 +0000 (21:30 +0100)]
widget: Reinstate custom closure func
It turns out it ws used in various places.
Benjamin Otte [Thu, 21 Nov 2019 20:20:16 +0000 (21:20 +0100)]
builder: Add gtk_builder_create_closure()
This will be the future way to connect signals automatically (and be
used for other things, too).
For now, gtk_builder_connect_signals_default() is ported to use it.
Benjamin Otte [Thu, 21 Nov 2019 18:36:06 +0000 (19:36 +0100)]
builder: Remove user_data argument from gtk_builder_connect_signals()
This is pretty unused and gets in the way of the next steps.
A potential side effect is that for templates the widget was passed as
the user data argument. If that turns out to be important, we have to
special case that situation.